package com.south.base.controller;

import com.south.base.service.HelloWorldAspectService;
import com.south.base.service.HelloWorldService;
import lombok.RequiredArgsConstructor;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @date 2019/5/24 17:24
 */
@RequiredArgsConstructor
@RestController
public class HelloWorld {
    private final HelloWorldService helloWorldService;
    private final HelloWorldAspectService helloWorldService2;

    @GetMapping("/hello")
    public String hello() {
        // 基本spring ioc依赖注入对象为原生对象
        return helloWorldService.hello();
    }

    @GetMapping("/hello2")
    public String hello2(@RequestParam("name")String name) {
        // 经过spring aop切面对象为代理对象
        return helloWorldService2.hello(name);
    }
}
